package cn.chenhuanming.shh.administer.entity.jpa;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalDateTime;
import java.util.HashSet;
import java.util.Set;

/**
 * House entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "house", catalog = "house")
public class House implements java.io.Serializable {

	// Fields

	private String id;
	private Estate estate;
	private Store store;
	private District district;
	private UserBroker userBroker;
	private String name;
	private String type;
	private String introduction;
	private String photo;
	private Float price;
	private Float area;
	private Short houseType;
	private String houseTypePicture;
	private String estateName;
	private String location;
	private Integer equityYear;
	private String ownerName;
	private String ownerPhone;
	private String ownershipCertificate;
	private String provinceName;
	private String cityName;
	private String cityAreaName;
	private LocalDateTime createTime;
	private String brokerName;
	private String isQuality;
	private String isAnxious;
	private String isRecommended;
	private String status;
	private Set<HouseMessage> houseMessages = new HashSet<HouseMessage>(0);
	private Set<HouseDetails> houseDetailses = new HashSet<HouseDetails>(0);
	private Set<HouseComplain> houseComplains = new HashSet<HouseComplain>(0);
	private Set<HouseQualityApply> houseQualityApplies = new HashSet<HouseQualityApply>(
			0);
	private Set<HouseOrderApply> houseOrderApplies = new HashSet<HouseOrderApply>(
			0);

	// Constructors

	/** default constructor */
	public House() {
	}

	/** minimal constructor */
	public House(String id, Estate estate, District district,
			UserBroker userBroker, String name, String type, Float price,
			Float area, Short houseType, String location, Integer equityYear,
			String ownerName, String ownerPhone, String ownershipCertificate,String provinceName,
			String cityName, String cityAreaName, String isQuality,
			String isAnxious, String status) {
		this.id = id;
		this.estate = estate;
		this.district = district;
		this.userBroker = userBroker;
		this.name = name;
		this.type = type;
		this.price = price;
		this.area = area;
		this.houseType = houseType;
		this.location = location;
		this.equityYear = equityYear;
		this.ownerName = ownerName;
		this.ownerPhone = ownerPhone;
		this.ownershipCertificate = ownershipCertificate;
		this.provinceName = provinceName;
		this.cityName = cityName;
		this.cityAreaName = cityAreaName;
		this.isQuality = isQuality;
		this.isAnxious = isAnxious;
		this.status = status;
	}

	/** full constructor */
	public House(String id, Estate estate, Store store, District district,
			UserBroker userBroker, String name, String type,
			String introduction, String photo, Float price, Float area,
			Short houseType, String houseTypePicture, String estateName,
			String location, Integer equityYear, String ownerName,
			String ownerPhone, String ownershipCertificate, String cityName,
			String cityAreaName, LocalDateTime createTime, String brokerName,
			String isQuality, String isAnxious, String isRecommended,
			String status, Set<HouseMessage> houseMessages,
			Set<HouseDetails> houseDetailses,
			Set<HouseComplain> houseComplains,
			Set<HouseQualityApply> houseQualityApplies,
			Set<HouseOrderApply> houseOrderApplies) {
		this.id = id;
		this.estate = estate;
		this.store = store;
		this.district = district;
		this.userBroker = userBroker;
		this.name = name;
		this.type = type;
		this.introduction = introduction;
		this.photo = photo;
		this.price = price;
		this.area = area;
		this.houseType = houseType;
		this.houseTypePicture = houseTypePicture;
		this.estateName = estateName;
		this.location = location;
		this.equityYear = equityYear;
		this.ownerName = ownerName;
		this.ownerPhone = ownerPhone;
		this.ownershipCertificate = ownershipCertificate;
		this.cityName = cityName;
		this.cityAreaName = cityAreaName;
		this.createTime = createTime;
		this.brokerName = brokerName;
		this.isQuality = isQuality;
		this.isAnxious = isAnxious;
		this.isRecommended = isRecommended;
		this.status = status;
		this.houseMessages = houseMessages;
		this.houseDetailses = houseDetailses;
		this.houseComplains = houseComplains;
		this.houseQualityApplies = houseQualityApplies;
		this.houseOrderApplies = houseOrderApplies;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 50)
	@GenericGenerator(name = "uuid16",strategy = "cn.chenhuanming.shh.administer.utils.IDGenerator")
	@GeneratedValue(generator = "uuid16")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "estate_id", nullable = false)
	public Estate getEstate() {
		return this.estate;
	}

	public void setEstate(Estate estate) {
		this.estate = estate;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "store_id")
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "city_area_id", nullable = false)
	public District getDistrict() {
		return this.district;
	}

	public void setDistrict(District district) {
		this.district = district;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "broker_id", nullable = false)
	public UserBroker getUserBroker() {
		return this.userBroker;
	}

	public void setUserBroker(UserBroker userBroker) {
		this.userBroker = userBroker;
	}

	@Column(name = "name", nullable = false, length = 40)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "type", nullable = false, length = 4)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "introduction")
	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	@Column(name = "photo")
	public String getPhoto() {
		return this.photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Column(name = "price", nullable = false, precision = 12, scale = 0)
	public Float getPrice() {
		return this.price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	@Column(name = "area", nullable = false, precision = 12, scale = 0)
	public Float getArea() {
		return this.area;
	}

	public void setArea(Float area) {
		this.area = area;
	}

	@Column(name = "house_type", nullable = false)
	public Short getHouseType() {
		return this.houseType;
	}

	public void setHouseType(Short houseType) {
		this.houseType = houseType;
	}

	@Column(name = "house_type_picture")
	public String getHouseTypePicture() {
		return this.houseTypePicture;
	}

	public void setHouseTypePicture(String houseTypePicture) {
		this.houseTypePicture = houseTypePicture;
	}

	@Column(name = "estate_name")
	public String getEstateName() {
		return this.estateName;
	}

	public void setEstateName(String estateName) {
		this.estateName = estateName;
	}

	@Column(name = "location", nullable = false, length = 30)
	public String getLocation() {
		return this.location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	@Column(name = "equity_year", nullable = false)
	public Integer getEquityYear() {
		return this.equityYear;
	}

	public void setEquityYear(Integer equityYear) {
		this.equityYear = equityYear;
	}

	@Column(name = "owner_name", nullable = false, length = 10)
	public String getOwnerName() {
		return this.ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	@Column(name = "owner_phone", nullable = false, length = 12)
	public String getOwnerPhone() {
		return this.ownerPhone;
	}

	public void setOwnerPhone(String ownerPhone) {
		this.ownerPhone = ownerPhone;
	}

	@Column(name = "ownership_certificate", nullable = false)
	public String getOwnershipCertificate() {
		return this.ownershipCertificate;
	}

	public void setOwnershipCertificate(String ownershipCertificate) {
		this.ownershipCertificate = ownershipCertificate;
	}

	@Column(name = "province_name")
	public String getProvinceName() {
		return this.provinceName;
	}

	public void setProvinceName(String provinceName) {
		this.provinceName = provinceName;
	}

	@Column(name = "city_name", nullable = false)
	public String getCityName() {
		return this.cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	@Column(name = "city_area_name", nullable = false)
	public String getCityAreaName() {
		return this.cityAreaName;
	}

	public void setCityAreaName(String cityAreaName) {
		this.cityAreaName = cityAreaName;
	}

	@Column(name = "create_time", length = 19)
	public LocalDateTime getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(LocalDateTime createTime) {
		this.createTime = createTime;
	}

	@Column(name = "broker_name")
	public String getBrokerName() {
		return this.brokerName;
	}

	public void setBrokerName(String brokerName) {
		this.brokerName = brokerName;
	}

	@Column(name = "is_quality", nullable = false, length = 6)
	public String getIsQuality() {
		return this.isQuality;
	}

	public void setIsQuality(String isQuality) {
		this.isQuality = isQuality;
	}

	@Column(name = "is_anxious", nullable = false, length = 2)
	public String getIsAnxious() {
		return this.isAnxious;
	}

	public void setIsAnxious(String isAnxious) {
		this.isAnxious = isAnxious;
	}

	@Column(name = "is_recommended", length = 2)
	public String getIsRecommended() {
		return this.isRecommended;
	}

	public void setIsRecommended(String isRecommended) {
		this.isRecommended = isRecommended;
	}

	@Column(name = "status", nullable = false, length = 4)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "house")
	public Set<HouseMessage> getHouseMessages() {
		return this.houseMessages;
	}

	public void setHouseMessages(Set<HouseMessage> houseMessages) {
		this.houseMessages = houseMessages;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "house")
	public Set<HouseDetails> getHouseDetailses() {
		return this.houseDetailses;
	}

	public void setHouseDetailses(Set<HouseDetails> houseDetailses) {
		this.houseDetailses = houseDetailses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "house")
	public Set<HouseComplain> getHouseComplains() {
		return this.houseComplains;
	}

	public void setHouseComplains(Set<HouseComplain> houseComplains) {
		this.houseComplains = houseComplains;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "house")
	public Set<HouseQualityApply> getHouseQualityApplies() {
		return this.houseQualityApplies;
	}

	public void setHouseQualityApplies(
			Set<HouseQualityApply> houseQualityApplies) {
		this.houseQualityApplies = houseQualityApplies;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "house")
	public Set<HouseOrderApply> getHouseOrderApplies() {
		return this.houseOrderApplies;
	}

	public void setHouseOrderApplies(Set<HouseOrderApply> houseOrderApplies) {
		this.houseOrderApplies = houseOrderApplies;
	}

}